package com.ls.controller.customer.model;

import com.ls.entity.Customer;
import com.ls.enums.SignEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import static com.ls.constant.SystemConstants.IS_PLATFORM_SIGN_FALSE;
import static com.ls.constant.SystemConstants.PLATFORM_SIGN_CONTENT;

//使用 @Data 注解自动生成getter/setter
@Data
public class AppGetLoginModel {
   @ApiModelProperty(value = "用户ID")
   private Long customerId;
   @ApiModelProperty(value = "是否会员 0否，1会员，-1过期")
   private Integer memberStatus;
   @ApiModelProperty(value = "会员等级")
   private Integer memberLevel;
   @ApiModelProperty(value = "发送通道，1 本机 2 平台")
   private Integer channelType;
   @ApiModelProperty(value = "手机号")
   private String phone;
   @ApiModelProperty(value = "签名")
   private String sign;
   /**
    * 是否使用平台签名，0使用自定义，1使用乐信通，默认乐信通，2使用智惠信使
    */
   @ApiModelProperty(value = "是否使用平台签名")
   private Integer isPlatformSign;
   // 新增全参构造方法
   public AppGetLoginModel(Customer customer) {
      this.customerId = customer.getCustomerId();
      this.phone = customer.getPhone();
      this.memberStatus = customer.getMemberStatus();
      this.memberLevel = customer.getMemberLevel();
      this.channelType = customer.getChannelType();
      this.isPlatformSign = customer.getIsPlatformSign();
      if(customer.getIsPlatformSign()!=IS_PLATFORM_SIGN_FALSE){
         this.sign = SignEnum.getSign(customer.getIsPlatformSign());
      }else{
         this.sign = customer.getSign();
      }
   }
}
